<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRegistryOrdersTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('registry_orders', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->bigInteger('registry_id')->unique()->comment('登记ID');
            $table->string('order_id', '64')->comment('商户订单号');
            $table->string('order_no', '64')->comment('平台订单号');
            $table->dateTime('pay_time')->nullable()->comment('支付时间');
            $table->string('pay_status', '16')->default(\App\Enums\PaymentStatus::PAYING)->comment('支付状态');
            $table->dateTime('expire_time')->nullable()->comment('订单过期时间');
            $table->string('payment_params', 512)->nullable()->comment('支付参数');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('registry_orders');
    }
}
